package code.google.model.player.states;

import android.media.AudioManager;
import android.media.MediaPlayer;
import code.google.model.util.interfaces.ISong;

public class StartState extends State {

	public StartState(StateManager manager) {
		super(manager);
	}

	@Override
	public boolean play(ISong song) {
		
		player = new MediaPlayer();
		player.setAudioStreamType(AudioManager.STREAM_MUSIC);
		currentSong = song;
		if(song.getStreamClientID() == ISong.CLIENT_LOCAL){
			manager.setCurrentState(manager.getIdleLocalState());
			return manager.getIdleLocalState().play(song);
		}
		else{
			manager.setCurrentState(manager.getIdleStreamState());
			return manager.getIdleStreamState().play(song);
		}
	}

}
